<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta content="telephone=no" name="format-detection" />
  <title>超级全能生</title>
  <meta itemprop="name" content="这场被誉为“小高考”的联考，为啥吸引上百万考生？" />
  <meta itemprop="image" content="/img/share-icon.jpg" />
  <meta name="description" itemprop="description" content="一百万高考生报名参加这场“小高考”超级全能生联考被刷屏炒火了！" />
  <link rel="stylesheet" href="/css/reset.css">
  <link rel="stylesheet" href="/css/normalize.css">
  <link rel="stylesheet" href="/css/lk/exam.css">
  <style>
    [v-cloak] {
      display: none;
    }
  </style>
  <script>
    ! function (e) {
      function t(a) {
        if (i[a]) return i[a].exports;
        var n = i[a] = {
          exports: {},
          id: a,
          loaded: !1
        };
        return e[a].call(n.exports, n, n.exports, t), n.loaded = !0, n.exports
      }
      var i = {};
      return t.m = e, t.c = i, t.p = "", t(0)
    }([function (e, t) {
      "use strict";
      Object.defineProperty(t, "__esModule", {
        value: !0
      });
      var i = window;
      t["default"] = i.flex = function (normal, e, t) {
        var a = e || 100,
          n = t || 1,
          r = i.document,
          o = navigator.userAgent,
          d = o.match(/Android[\S\s]+AppleWebkit\/(\d{3})/i),
          l = o.match(/U3\/((\d+|\.){5,})/i),
          c = l && parseInt(l[1].split(".").join(""), 10) >= 80,
          p = navigator.appVersion.match(/(iphone|ipad|ipod)/gi),
          s = i.devicePixelRatio || 1;
        p || d && d[1] > 534 || c || (s = 1);
        var u = normal ? 1 : 1 / s,
          m = r.querySelector('meta[name="viewport"]');
        m || (m = r.createElement("meta"), m.setAttribute("name", "viewport"), r.head.appendChild(m)), m.setAttribute(
          "content", "width=device-width,user-scalable=no,initial-scale=" + u + ",maximum-scale=" + u +
          ",minimum-scale=" + u), r.documentElement.style.fontSize = normal ? "50px" : a / 2 * s * n + "px"
      }, e.exports = t["default"]
    }]);
    flex(false, 100, 1);
  </script>
</head>

<body>
  <div class="content" v-cloak>
    <img src="/img/banner.jpg" alt="" class="imgTop">
    <div class="query" v-if="Islogin">
      <div class="phone">
        <input type="tel" name="phone" placeholder="请输入手机号" v-model="queryInfo.phone">
        <div class="tel">
          <input type="tel" placeholder="请输入六位验证码" name="sms_code" class="smsCode" v-model="queryInfo.sms">
          <span class="send" @click="handleSend">{{smsText}}</span>
        </div>
        <button @click="handleLogin">登录</button>
      </div>
    </div>
    <div class="ks" v-if="show">
      <ul>
        <li class="firstLi">
          <p class="first">全国卷一、卷二已经考试完毕，请点击  我要在线答题 --> 报名校验，查看答案解析</p>
          <p style="color:#000;">浙江卷考试即将开始</p>
        </li>
        <li>
          <span>●</span>
          <div>
              浙江卷考试开放时间：
            <div style="text-align:center;margin-top:10px;">3月23日18:00至28日12:00</div>
            <p>在考试期间内都可参加考试</p>
          </div>
        </li>
        <li>
          <span>●</span>
          <div>
            答题方式一：在线作答
            <p>请准备好笔和纸，主观题需要写在纸上拍照上传</p>
          </div>
        </li>
        <li>
          <span>●</span>
          <div>
            答题方式二：下载试卷作答
            <p>下载打印试卷作答，作答完毕后选在线答题录入答案，客观题录入，主观题拍照上传</p>
          </div>
        </li>
        <li>
          <p><span style="color:#000;font-weight:700">全国卷一地区：</span>安徽、 湖北、 福建、 湖南、 山西、 河北、 江西、 广东、 河南、 北京、 山东、 天津、 江苏、 上海、 海南</p>
          <p>剩余地区除浙江都是全国卷二</p>
        </li>
      </ul>
      <footer>
        <button class="left" @click="handleIsDownLoad">我要下载试卷</button>
        <button class="right" @click="handleHref">我要在线答题</button>
      </footer>
      <!-- <textarea>111</textarea> -->
    </div>
    <div class="bg" v-show="bg">
      <button class="rtn" @click="handleReturn">返回</button>
      <span>使用说明</span>
      <p class="copy">请您点击复制链接按钮复制地址，打开浏览器在地址栏中粘贴访问下载</p>
      <p class="tl">听力地址</p>
      <!-- <p class="sjType">试卷类型</p> -->
      <textarea class="p" id="id_Tltext">{{tlTime}}</textarea>
      <p class="sj">试卷地址</p>
      <!-- <p class="sjType">试卷类型</p> -->
      <textarea class="p" id="id_text">{{ksTime}}</textarea>
      <div class="dv">
        <button class="tlBtn" @click="handleTlBtn" id="id_copy" data-clipboard-action="copy" data-clipboard-target="#id_Tltext">复制听力链接</button>
        <button class="btn" @click="handleBtn" id="id_copy" data-clipboard-action="copy" data-clipboard-target="#id_text">复制试卷链接</button>
      </div>
    </div>
    <div class="kModal" v-if="modal">
      <div class="modal">
        <p>{{ksTime}}</p>
        <button @click="handleKnow">知道了</button>
      </div>
    </div>
  </div>
  <script src="https://sfile.tl100.com/js/libs/vue.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script>
  <script src="https://sfile.tl100.com/js/libs/axios.min.js"></script>
  <script>
    var api = axios.create({
      baseURL: 'https://api.tl100.com/exam_signup',
      withCredentials: true,
      timeout: 5000,
      headers: { 'Content-Type': 'application/json;charset=UTF-8' }
    });
    function setLog(api, error) {
      var mydate = new Date();
      mydate.setHours(mydate.getHours() + 8)
      axios.post('https://m.tl100.com/sce', {
        date: mydate,
        api: api,
        info: error
      });
    }
    new Vue({
      el: '.content',
      data: {
        smsText: '发送',
        ksTime: '您未报名，不能下载试卷',
        tlTime: '',
        bg: false,
        queryInfo: {
          phone: '',
          sms: ''
        },
        Islogin: false,
        leftButton: false,
        bg: false,
        downLoads: true,
        show: true,
        modal: false,
        btn: false,
        tlBtn: false
      },
      mounted() {
        <% if (times == 2) {%>
          this.downLoads = false;
        <%}%>
      },
      methods: {
        handleSend: function () {
          if (!(/^[1][3,4,5,7,8][0-9]{9}$/.test(this.queryInfo.phone))) {
            alert("不是完整的11位手机号或者正确的手机号前七位");
            return false;
          }
          if (this.smsSending) {
            return;
          }
          var i = 60;
          this.smsSending = true;
          this.smsText = '60s';
          var timeId = setInterval(() => {
            i--;
            this.smsText = (i + 's');
            if (i == 0) {
              clearInterval(timeId);
              this.smsText = '发送';
              this.smsSending = false;
            }
          }, 1000);
          var vm = this;
          api.post('/api/user/sendSmsCode', {
            phone: this.queryInfo.phone,
          }).then(function (res) {
            if (res.data.res_code != 1) {
              alert('发送失败，请稍后重试！');
              setLog('/api/user/sendSmsCode:fail', JSON.stringify(res.data));
              clearInterval(timeId);
              vm.smsText = '发送';
              vm.smsSending = false;
            }
          }).catch(function (error) {
            setLog('/api/user/sendSmsCode:catch', JSON.stringify(error));
          })
        },
        handleLogin: function () {
          if (this.queryInfo.phone == "") {
            alert('请填写手机号！');
            return;
          }
          if (!(/^[1][3,4,5,7,8][0-9]{9}$/.test(this.queryInfo.phone))) {
            alert("请输入正确的手机号码！");
            return false;
          }
          if (this.queryInfo.sms == "") {
            alert('请填写验证码！');
            return;
          }
          var vm = this;
          api.post('/api/user/login', {
            phone: this.queryInfo.phone,
            sms_code: this.queryInfo.sms
          })
            .then(function (res) {
              if (res.data.res_code == 1) {
                vm.token = res.data.msg.token
                localStorage.setItem('token', res.data.msg.token);
                vm.bg = true;
                vm.Islogin = false;
                api.post('/api/sign_up/getExamPaperDownloadUrl', {
                  token: localStorage.getItem('token')
                }).then(function (res) {
                  console.log(res);
                  vm.ksTime = res.data.msg;
                  if (res.data.res_code == 1) {
                    vm.bg = true;
                  } else {
                    vm.modal = true;
                  }
                }).catch(function (error) {
                  setLog('/api/sign_up/getExamPaperDownloadUrl:catch', JSON.stringify(error))
                });
              } else {
                alert(res.data.msg);
                setLog('/api/user/login:fail', JSON.stringify(res.data));
              }
            })
            .catch(function (error) {
              alert('登录超时，请刷新页面重试！');
              setLog('/api/user/login:catch', JSON.stringify(error));
            });
        },
        handleIsDownLoad: function () {
          if (this.leftButton) {
            return;
          }
          if (localStorage.getItem('token') && localStorage.getItem('token') != '') {
            this.leftButton = true;
            var vm = this;
            api.post('/api/sign_up/getExamPaperDownloadUrl_baidu', {
              token: localStorage.getItem('token')
            }).then(function (res) {
              console.log(res);
              if (res.data.res_code == 1) {
                location.href = res.data.msg;
                return;
                vm.bg = true;
                vm.leftButton = false;
                vm.show = false;
              } else {
                vm.modal = true;
                vm.leftButton = false;
              }
            }).catch(function (error) {
              setLog('/api/sign_up/getExamPaperDownloadUrl:catch', JSON.stringify(error));
              vm.leftButton = false;
            });
          } else {
            this.Islogin = true;
            this.show = false
          }
        },
        handleBtn: function () {
          // var e=document.querySelector(".p");//对象是contents 
          // e.select(); //选择对象 （全选）
          // document.execCommand("Copy"); //执行浏览器复制命令
          if ( this.btn ) {
            return;
          } 
          this.btn = true;
          var vm = this;
          var clipboard = new ClipboardJS('.btn');
          clipboard.on("success", function (e) {
            vm.btn = false;
            alert('复制成功');
            console.info("复制成功，复制内容：    " + e.text);
            clipboard.destroy() 
          }); 
          clipboard.on("error", function (e) {
            vm.btn = false;
            console.info(e);
            clipboard.destroy() 
          })
        },
        handleKnow: function () {
          this.modal = false
        },
        handleHref: function () {
          if (!this.downLoads) {
            this.modal = true;
            return;
          }
          location.href = 'https://exam.521ke.com/lineExam/examList?o=tlgzh';
        },
        handleReturn: function () {
          this.show = true;
          this.bg = false;
        },
        handleTlBtn: function () {
          if (this.tlBtn) {
            return;
          }
          this.tlBtn = true;
          var vm = this;
          var clipboard = new ClipboardJS('.tlBtn');
          clipboard.on("success", function (e) {
            vm.tlBtn = false;
            alert('复制成功');
            console.info("复制成功，复制内容：    " + e.text);
            clipboard.destroy() 
          }); 
          clipboard.on("error", function (e) {
            vm.tlBtn = false;
            console.info(e);
            clipboard.destroy() 
          })
        }
      }

    })
  </script>
</body>

</html>